package edu.zut2.extends_demo;

/**
 * 此类作为Student以及Teacher的父类
 * 创建子类对象时，系统有没有帮助我们创建父类对象？ 有
 *
 */
public class People {

    private String name;
    private int age;
    private String sex;
    private String sn;

    //父类中，建议有参构造、无参构造都定义
    public People(){
        System.out.println("父类的构造执行........");
    }

    public People(String name, int age, String sex, String sn) {
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.sn = sn;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public void say(){
        System.out.println("我叫：" + name + "，今年" + age + "岁，性别："
                + sex + ",身份证号：" + sn );
    }

}
